/*
 * Copyright (C) 2015 Actor LLC. <https://actor.im>
 */

.dropdown {
  position: relative;
  &--opened {
    .dropdown__button {
      visibility: visible;

      //transition: opacity $default-transition-duration $default-transition-timing, visibility 0s;

      opacity: 1;
    }
    .dropdown__menu {
      visibility: visible;

      //transition: opacity $default-transition-duration $default-transition-timing, visibility 0s;

      opacity: 1;
    }
  }
  &__button {
    display: inline-block;

    cursor: pointer;
  }
  &__menu {
    position: absolute;
    z-index: 5;
    top: 47px;

    visibility: hidden;

    min-width: $dropdown-min-width;
    margin: 0;
    padding: 8px 0;

    list-style: none;

    //transition: opacity $default-transition-duration $default-transition-timing, visibility 0s $default-transition-duration;

    opacity: 0;
    border-radius: 2px;
    background-color: rgba(white, .975);
    box-shadow: 0 1px 2px 1px rgba(black, .15);

    &--right {
      right: 0;
    }
    &--left {
      left: 0;
    }
    &__item {
      font-size: 15px;
      line-height: 22px;

      padding: 10px 16px 10px 50px;

      cursor: pointer !important;

      color: $greyish-brown;
      .icon {
        float: left;

        width: 22px;
        height: 22px;
        margin-right: 0;
        margin-left: -32px;
      }
      i {
        font-size: 22px;
        line-height: 22px;

        float: left;

        width: 22px;
        height: 22px;
        margin-left: -34px;

        color: rgba(0, 0, 0, .25);
      }
      &--light {
        color: rgba(0, 0, 0, .4);
      }
      &:hover {
        color: white;
        background-color: $dark-sky-blue;
        .icon,
        i {
          color: white;

          fill: white !important;
        }
      }
    }
    &__separator {
      height: 8px;
      &:hover {
        cursor: default !important;

        background-color: transparent;
      }
    }
  }

  &--mentions {
    .dropdown__menu {
      position: absolute;
      top: auto;
      bottom: 6px;

      overflow: auto;

      max-height: 210px;
      .dropdown__menu__item {
        .avatar {
          float: left;

          margin-top: -1px;
          margin-right: 0;
          margin-left: -34px;
        }
        &:hover {
          color: $greyish-brown;
          background-color: transparent;
        }
        &--active {
          color: white !important;
          background-color: $dark-sky-blue !important;
        }
      }
    }
  }
  &--small {
    .dropdown__menu {
      overflow: hidden;

      min-width: 160px;
      padding: 0;
      &__item {
        font-size: 14px;
        line-height: 20px;
        //font-weight: 500;

        padding: 6px 16px 6px 40px;
        .icon {
          font-size: 18px;
          line-height: 20px;
        }
      }
    }
  }
}

// Mentions dropdown
.mention {
  position: relative;

  display: none;
  &__wrapper {
    position: absolute;
    z-index: 5;
    bottom: 0;
    left: 1px;

    overflow: hidden;

    max-width: 500px;

    border-radius: 2px;
    background-color: rgba(white, .975);
    box-shadow: 0 0 0 1px $cloudy-blue, 0 0 6px 0 rgba(black, .13);
  }
  &__header {
    font-size: 12px;
    line-height: 20px;

    padding: 4px 14px;

    color: rgba($greyish-brown, .6);
    border-bottom: 1px solid #ebebeb;
    background-color: white;

    @include clearfix();

    span,
    strong {
      display: inline-block;
    }
    .pull-left {
      margin-right: 18px;
    }
    .material-icons {
      font-size: 16px;
      line-height: 20px;
    }
  }
  &__list {
    font-size: 15px;

    overflow: auto;

    max-height: 228px;
    margin: 0;
    padding: 8px 0;

    list-style: none;

    color: $greyish-brown;
    &__item {
      padding: 7px 14px;
      .avatar {
        margin-right: 10px;
      }
      .title {
        display: inline-block;
        span {
          display: inline-block;

          color: rgba(black, .3);
          &.nickname {
            &:after {
              display: inline-block;

              padding: 0 6px;

              content: '•';
              vertical-align: middle;

              color: rgba(black, .3);
            }
          }
          &:first-child {
            color: $greyish-brown;
          }
        }
      }

      &--active {
        background-color: $dark-sky-blue2;
        .title {
          span {
            color: rgba(white, .6);
            &.nickname {
              &:after {
                color: rgba(white, .6);
              }
            }
            &:first-child {
              color: white;
            }
          }
        }
      }
    }
  }

  &--opened {
    display: block;
  }
}
